package com.sylli.oeuf.server.game.logic.skill.passive;

import java.util.ArrayList;
import java.util.Collection;

import com.sylli.oeuf.server.game.logic.ActionProduct;
import com.sylli.oeuf.server.game.logic.BattleActor;
import com.sylli.oeuf.server.game.logic.Buff;
import com.sylli.oeuf.server.game.logic.CastingTarget;
import com.sylli.oeuf.server.game.logic.EventParameter;
import com.sylli.oeuf.server.game.logic.action.CombatLog;
import com.sylli.oeuf.server.game.logic.action.StatusModifier;
import com.sylli.oeuf.server.game.logic.invocation.InvocationAction;
import com.sylli.oeuf.server.game.logic.invocation.InvocationCondition;
import com.sylli.oeuf.server.game.logic.invocation.InvocationEntry;
import com.sylli.oeuf.server.game.logic.invocation.InvocationEvent;
import com.sylli.oeuf.server.object.transferable.StatTO;

public class Vampire_HellBlue_Buff extends Buff {
	public Vampire_HellBlue_Buff() {
		super("hellblue_buff", 3);
		this.getEntries().put(
				InvocationEvent.STD_IE_ON_TICK,
				new InvocationEntry(
						InvocationCondition.ALWAYS_TRUE_IC,
						new InvocationAction() {
							@Override
							public Collection<ActionProduct> act(
									int rank, BattleActor caster,
									CastingTarget target,
									EventParameter ep) {
								
								StatTO strChange = new StatTO((int) (caster.getBaseStat().getStatStr() * 0.5), 0, 0, 0, 0, 0, 0, 0, 0, 0);
								
								Collection<ActionProduct> product = new ArrayList<ActionProduct>();
								product.add(new StatusModifier(caster, 
										caster, strChange));
								if(ttl == maxTtl) {
									product.add(new CombatLog(caster, caster.getProperTarget(CastingTarget.FocusTarget),
										caster.getName() + "'s STR is increased by " + strChange.getStatStr() + "."));
								} else if(ttl == 0) {
									product.add(new CombatLog(caster, caster.getProperTarget(CastingTarget.FocusTarget),
										"[hellblue]'s effect is about to fade from " + caster.getName() + "..."));
								}
								return product;
							}
						}));
	}

}